<{if $shops}>
  <span id="msg"></span>
  <div class="division">
     店铺:&nbsp;&nbsp;
     <select name="shop_id" id="shop_id">
         <{foreach from=$shops item=item key=key}>
        <option value="<{$item.shop_id}>" order_type="<{$item.order_type}>"><{$item.name}></option>
        <{/foreach}>
     </select><br/><br/>
     订单号:<{input vtype="required" name="order_id" value="" id="order_bn"}>
     <br/><br/>&nbsp;&nbsp;
    <{button type="submit" label="立即获取订单详情" class="btn-secondery" id="btn_manual"}>
  </div>


<script>

    $("btn_manual").addEvent("click",function(e){
        e.stop();
        var order_type =$('shop_id').getElement('option:selected').get('order_type');

        new Request({
            url:'index.php?app=ome&ctl=admin_shop&act=sync_order',
            data:'order_id='+$("order_bn").value+"&shop_id="+$("shop_id").value+'&order_type='+order_type,
            method:'post',
            onSuccess:function(response){
                var resp =  JSON.decode(response);
                if(resp.rsp=="fail"){
                var tip=$('msg').getElement('.error') || new Element('span.error caution').inject($('msg'));
                    tip.set('text','出错原因：'+resp.msg);
                    tip.destroy.delay(2000,tip);

                }else{
                var tip=$('msg').getElement('.success') || new Element('span.success').inject($('msg'));
                    tip.set('text','获取成功');
                    tip.destroy.delay(2000,tip);
                }
            }
        }).send();
    });

</script>
<{else}>
  <div class="division">
    <span class="red">本系统暂时没有可获取订单的店铺</span>
  </div>
<{/if}>